package com.icinfo.cloud.provider.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.ObjectUtils;

/**
 * 检查-性别枚举
 * @author HKxxx
 * @date 2024/1/15 11:17
 */
@AllArgsConstructor
public enum CheckGenderEnum {

    /**
     * 女
     */
    CERT_60("0", "女"),
    /**
     * 男
     */
    CERT_90("1", "男");

    @Getter
    private String code;

    @Getter
    private String value;

    public static String getValueByCode(String code){
        if (ObjectUtils.isEmpty(code)) {
            return null;
        }
        for (CheckGenderEnum value : CheckGenderEnum.values()) {
            if (code.equals(value.getCode())){
                return value.getValue();
            }
        }
        return null;
    }

}
